<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AMC-Merchant System</title>
<link href="./style.css" rel="stylesheet">
</head>
<body>
	<table align="center" border="1">
		<tr>
			<td>foodId</td>
			<td>foodName</td>
			<td>foodPrice</td>
			<td>foodPic</td>
			<td>foodFoodType</td>
			<td>merchant</td>
			<td>delete</td>
			<td>update</td>
		</tr>
		<c:forEach items="${foodsList}" var="food">
			<tr>
				<td>${food.getFoodId()}</td>
				<td>${food.getFoodName()}</td>
				<td>${food.getFoodPrice()}</td>
				<td><img src="${food.getFoodPic()}" style="width: 60px; height: 60;" /></td>
				<td>
					<c:forEach items="${foodTypesMap}" var="fm">
					<c:if test="${fm.key == food.getFoodFoodTypeId()}">
						${fm.value}
					</c:if>
				</c:forEach>
				</td>
				<td>
					<c:forEach items="${merchantsMap}" var="mm">
					<c:if test="${mm.key == food.getMerchantId()}">
						${mm.value}
					</c:if>
				</c:forEach>
				</td>
				<td><a href="DeleteFoodsServlet?foodId=${food.getFoodId()}">delete</a></td>
				<td><a href="UpdateFoodsContentServlet?foodId=${food.getFoodId()}">update</a></td>
			</tr>
		</c:forEach>
	</table>
	
	<a href="AddFoodsContentServlet">ADD</a>
</body>
</html>